<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title>标题1</title>
	<meta name="keywords" content="">
	<meta name="description" content="">
</head>
<body>
	<div>账号：<input type="text" name="" value="" class="zc"></div>
	<div>密码：<input type="text" name="" value="" class="mm"></div>
	<div>确认：<input type="text" name="" value="" class="qr"></div>
	<button class="btn">注册</button>
</body>
<script src="js/jquery-1.10.1.min.js"></script>
<script>
$('.btn').click(function(){
	if($('.mm').val()==$('.qr').val()){
		$.ajax({
			type:'get',
			url:'http://datainfo.duapp.com/shopdata/userinfo.php',
			datatype:'json',
			data:{status:'register',userID:$('.zc').val(),password:$('.mm').val()},
			success:function(data){
					if(data==0){
						alert('重名')
					}
					if(data==1){
						alert('成功')

						window.open('dl.html','_self');
					}
					if(data==2){
						alert('报错')
					}
			}
		})

		
		
		

	}else{
		alert('两次输入密码不一致')
	}
		localStorage.setItem('userID',$('.zc').val())
		localStorage.setItem('password',$('.mm').val())
	
})



// localStorage.setItem('userID',$('.zc').val())
// 		window.open('test2.html','_self')
</script>

</html>